﻿@using Surging.Core.CPlatform;
@model List<Surging.Core.CPlatform.ServiceDescriptor>
@{
    ViewBag.Title = "容错规则";
    var isPjax = !string.IsNullOrEmpty(Context.Request.Headers["X-PJAX"]) && bool.Parse(Context.Request.Headers["X-PJAX"]);
    Layout = isPjax ? null : "_ServiceManageLayout.cshtml";
}
<div class="page-header">
    <h1>
        服务管理
        <small>
            <i class="icon-double-angle-right"></i>
            容错规则
        </small>
    </h1>
    <div class="ace-settings-container">
        <a href="@Context.Request.Headers["Referer"]" class="btn btn-app btn-xs btn-warning ace-settings-btn" data-pjax=".page-content">
            <i class="icon-back bigger-150"></i>
        </a>


    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
            <div class="row">
                <div class="col-sm-6">
                    <form id="searchForm">
                        关键字：<input type="text" name="queryParam" id="queryParam" placeholder="服务Id">
                        <input type="hidden" name="serviceId" value="@ViewBag.ServiceId" />
                        <input type="hidden" name="address" value="@ViewBag.Address" />
                        <button id="btnSearch" type="submit" class="btn btn-primary">搜&#12288;索</button>
                    </form>
                </div>
            </div>
            <div>
                <table id="dataFaultTolerant" class="table table-striped table-bordered table-hover dataTable">
                    <thead>
                        <tr role="row">
                            <th style="width: 6%"></th>
                            <th class="center"  width="6%">服务ID</th>
                            <th class="center"  width="6%">强制熔断</th>
                            <th class="center" width="6%">容错策略</th>
                            <th class="center" width="6%">超时时间</th>
                            <th class="center" width="6%">开启缓存</th>
                            <th class="center" width="9%">回退实例名</th>
                            <th class="center" width="9%">注入脚本</th>
                            <th class="center" width="9%">命名空间</th>
                            <th class="center" width="6%">错误率</th>
                            <th class="center" width="6%">尝试请求</th>
                            <th class="center" width="6%">关闭熔断</th>
                            <th class="center" width="6%">熔断阚值</th>
                            <th class="center" width="6%">信号并发</th>
                            <th class="center" width="6%">操作</th>
                        </tr>
                    </thead>
                    <tbody id=""></tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- Modal -->

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 700px;">
        <div class="modal-content">
            <form id="eventForm" action="" name="eventForm" method="post" class="form-horizontal">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">容错规则编辑</h4>
                </div>
                <div class="modal-body" >

                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary" id="submitEvent" data-loading-text='<i class="icon-spinner icon-spin bigger-110"></i>提交中...' autocomplete="off">提交</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
@if (!isPjax)
{
    @section SubFootJS
        {
        <script type="text/javascript">
            seajs.use("apps_servicemange/view/faulttolerant.guide.js", function(a) {
            a.init({
            });
        });
        </script>
    }
}
else
{
    <script type="text/javascript">
        seajs.use("apps_servicemange/view/faulttolerant.guide.js", function (a) {
            a.init({
            });
        });
    </script>
}